/*
* Copyright 2016 YONYOU Corporation Ltd. All Rights Reserved.
*
* This software is published under the terms of the YONYOU Software
* License version 1.0, a copy of which has been included with this
* distribution in the LICENSE.txt file.
*
* @Project         marketing

* @Package         com.yonyou.marketing.message.push.entrance

* @Author          LuZhen

* @FileName        MessageProtocolContent

* @Date            16/11/9

----------------------------------------------------------------------------------
*     Date          Who             Version         Comments
* 1. 16/11/9        LuZhen          1.0             Create Source
*
----------------------------------------------------------------------------------
*/
package org.marketing.common.entity.wechatpushmessage;


import org.marketing.common.constants.MessagePushConstant;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 消息内容 前端解析 APP自定义解析
 */
public class WeChatMessageProtocolMessageContent {

    /**
     * 消息标题，可选
     */
    private String title;

    /**
     * 消息内容，必填
     */
    @NotNull
    private String content;

    /**
     * 内容类型，可选
     */
    private MessagePushConstant.MESSAGE_CONTENT_TYPE contentType;
    
    /**
     * 来源类型10011001-微信,10011002-APP
     */
    private Integer sourceType;


    /**
     * 推送附加参数，可以自定义，可以是特殊消息的要求
     * 比如 key1=value1,app可以自解析
     */
    private Map<String,String> extraParaMap= new HashMap<>();

    public List<WeChatMessageProtocolMessageLinkContent> getLinkContentList() {
        return linkContentList;
    }

    public void addLinkContentList(WeChatMessageProtocolMessageLinkContent linkContent) {
        this.linkContentList.add(linkContent);
    }

    public void addLinkContentList(List<WeChatMessageProtocolMessageLinkContent> linkContent) {
        this.linkContentList.addAll(linkContent);
    }

    /**
     * 相链接的子内容
     * 比如微信微客服的图文消息的连接信息、视频消息的缩略等
     */
    private List<WeChatMessageProtocolMessageLinkContent> linkContentList= new ArrayList<>();

    /**
     * 自板内容,供APP子解析
     */
    private List<WeChatMessageProtocolMessageTemplateContent> templateContentList = new ArrayList<>();

    public List<WeChatMessageProtocolMessageTemplateContent> getTemplateConentList() {
        return templateContentList;
    }

    public void addTemplateConentList(WeChatMessageProtocolMessageTemplateContent templateContent) {
        this.templateContentList.add(templateContent);
    }

    public void addTemplateConentList(List<WeChatMessageProtocolMessageTemplateContent>  templateContent) {
        this.templateContentList.addAll(templateContent);
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public MessagePushConstant.MESSAGE_CONTENT_TYPE getContentType() {
        return contentType;
    }

    public void setContentType(MessagePushConstant.MESSAGE_CONTENT_TYPE contentType) {
        this.contentType = contentType;
    }

    public Map<String, String> getExtraParaMap() {
        return extraParaMap;
    }

    public void addExtraParaMap(Map<String, String> extraParaMap) {
        this.extraParaMap.putAll(extraParaMap);
    }

    public void addExtraParaMap(String key,String value) {
        this.extraParaMap.put(key,value);
    }

    
    /**
     * @return the sourceType
     */
    public Integer getSourceType() {
        return sourceType;
    }

    
    /**
     * @param sourceType the sourceType to set
     */
    public void setSourceType(Integer sourceType) {
        this.sourceType = sourceType;
    }
    
    

}
